<?xml version='1.0' encoding='iso-8859-1'?>
<!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
	<head>
		<title>
			CM_ENCRYPTED.sh
			</title>
		<meta http-equiv='content-type' content='text/html;iso-8859-1'/>
		<meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
		<meta name='author' content='cmaier@cmassoc.net'/>
		<meta name='robots' content='noindex,nofollow'/>
		<link href='toolkit.css' rel='stylesheet' type='text/css'/>
		</head>
	<body>
		<div class='headerlink'>
			[<a href='boot.sh.html' title=' boot.sh '>PREV</a>]
			[<a href='toolkit.html' title=' Index '>HOME</a>]
			[<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
			</div>
<pre>
#!/bin/sh
# file: scripts/CM_ENCRYPTED.sh

# This script formats and sends a CM_ENCRYPTED_PAYBOOT message to a
# specific slave device; the message is written as a text file then
# passed to efsu to send;  
 
# ====================================================================
# host symbols;
# --------------------------------------------------------------------

. ./hardware.sh

# ====================================================================
# file symbols;
# --------------------------------------------------------------------

COUNT=1
FRAME=test.hex

# ====================================================================
#  display usage information;e
# --------------------------------------------------------------------

usage()
{
cat &lt;&lt; EOF
usage: ${options}

This scripts sets the up and down bandwidth on Slave devices in the network

OPTIONS
	-h	show this message
	-s	slave device name
	-u	Upstream Bandwidth required in Mbps
	-d	Downstream Bandwidth required in Mbps

Note: Bandwidth value support 0-15 input values and 0 selects full line rate

EOF
}

# ====================================================================
#  command line parser routine
# --------------------------------------------------------------------

device=

while getopts &quot;hs:u:d:&quot; OPTION
do
	case ${OPTION} in
	h)
	usage
	exit 1
	;;
	s)
	device=${OPTARG}
	;;
	esac
done

if [[ -z ${device} ]]; then
	usage
	exit 1
elif [ ${device} = slave1 ]; then 
	target=${slave1}
elif [ ${device} = slave2 ]; then 
	target=${slave2}
elif [ ${device} = slave3 ]; then 
	target=${slave3}
elif [ ${device} = slave4 ]; then 
	target=${slave4}
elif [ ${device} = slave5 ]; then 
	target=${slave5}
else 
	target=${master}
fi

# ====================================================================
# Format the MME with processed values from command line
# --------------------------------------------------------------------

da=&quot;ff ff ff ff ff ff&quot;
sa=&quot;ff ff ff ff ff ff&quot;
mtype=&quot;88 e1&quot;
mmv=&quot;01&quot;
mmtype=&quot;06 60&quot;
FMI=&quot;00 00&quot;
PEKS=&quot;0F&quot;
AVLN=&quot;00&quot;
PID=&quot;04&quot;
PRN=&quot;09 75&quot;
PMN=&quot;01&quot;
UUID=&quot;55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa&quot;
LEN=&quot;00 00&quot;
HLE=&quot;AA 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 55&quot;
fill=&quot;ff ff ff ff ff ff ff ff ff&quot; 

cat &gt; ${FRAME} &lt;&lt;EOF
${da} ${sa} ${mtype} ${mmv} ${mmtype} ${FMI} ${PEKS} ${AVLN} ${PID} ${PRN} ${PMN} ${UUID} ${LEN} ${HLE} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill} ${fill}
EOF

# ====================================================================
# check environment; 
# --------------------------------------------------------------------

if [ ! -f ${FRAME} ]; then
	echo &quot;File ${FRAME} is missing or misplaced&quot;
	exit 1
fi
	

# ====================================================================
# send traffic in both directions;
# --------------------------------------------------------------------

efsu -i ${ETH2} -h ${FRAME} -l ${COUNT} -v

rm ${FRAME}


</pre>
		<div class='footerlink'>
			[<a href='boot.sh.html' title=' boot.sh '>PREV</a>]
			[<a href='toolkit.html' title=' Index '>HOME</a>]
			[<a href='firmware.sh.html' title=' firmware.sh '>NEXT</a>]
			</div>
		</body>
	</html>
